package cn.zktr.Personnel.controllers.zhouxiong;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

import cn.zktr.Personnel.model.service.zhouxiong.*;

@Controller
public class JiaBuBanController {

	@Autowired
	private NoimpService noimp;

	@RequestMapping("zx/jia-ban")
	public void jiaban() {}
	
	@RequestMapping("zx/bu-ban")
	public void buban() {}
	
	
	
	@RequestMapping("JiaBuBan")
	@ResponseBody
	public Map<String,Object> banci(String DATE,int page,int rows) {
		Map<String,Object> map = new HashMap<>();
		//页内容
		map.put("total",noimp.seleJiaBanShuJu(DATE).size());
		Page<Object> p=PageHelper.startPage(page,rows);
		JSONArray findAll=noimp.seleJiaBanShuJu(DATE);
		map.put("rows",findAll);
		return map;
	}
	
	@RequestMapping("updateJiaBan")
	@ResponseBody
	public String updateJiaBan(Integer EMPID,Integer RSNID,String QTSTIME,String QTSREM) {
		String ban = noimp.updateJiaBan(EMPID, RSNID, QTSTIME, QTSREM);
		return ban;
	}
}
